package net.xo68.destiny.contract.domain;

import io.swagger.annotations.ApiModel;
import net.xo68.destiny.contract.common.SystemConstants;

/**
 * 字条串响应结果
 * @author wuxie
 * @version 2020-10-25
 */
@ApiModel("字符串响应结果")
public class StringRespondResult extends RespondResult<String> {

    public static StringRespondResult ok(){
        return ok(SUCCESS_MESSAGE);
    }
    public static StringRespondResult ok(String message){
        return ok(message, SystemConstants.STRING_EMPTY);
    }
    public static StringRespondResult ok(String message,String body){
        StringRespondResult respondResult=new StringRespondResult();
        respondResult.setState(SUCCESS);
        respondResult.setMessage(message);
        respondResult.setBody(body);
        return respondResult;
    }
    public static StringRespondResult fail(){
        return fail(FAIL_MESSAGE);
    }
    public static StringRespondResult fail(String message){
        StringRespondResult respondResult=new StringRespondResult();
        respondResult.setState(FAIL);
        respondResult.setMessage(message);
        return respondResult;
    }

}
